//
//  MessageTableViewCell.m
//  FlyingEagle
//
//  Created by Lj on 2017/2/13.
//  Copyright © 2017年 lj. All rights reserved.
//

#import "MessageTableViewCell.h"

@interface MessageTableViewCell()


@end

@implementation MessageTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        [self initView];
    }
    return self;
}

- (void)initView {
    //头像
    self.headImage = [[UIImageView alloc]init];
    self.headImage.image = [UIImage imageNamed:@"home-1"];
    self.headImage.clipsToBounds = YES;
    self.headImage.layer.cornerRadius = 45.0/2;
    [self addSubview:self.headImage];
    [self.headImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.mas_centerY);
        make.left.equalTo(self.mas_left).offset(15);
        make.height.width.offset(45);
    }];
    //名字
    self.nameLabel = [[UILabel alloc]init];
    self.nameLabel.textColor = Text_Color_000000;
    self.nameLabel.text = @"天湖国际";
    self.nameLabel.font = BHFont_Size_15;
    [self addSubview:self.nameLabel];
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self).offset(10);
        make.left.equalTo(self.headImage.mas_right).offset(10);
        make.width.offset(App_Frame_Width/2);
    }];
    //消息
    self.messageLabel = [[UILabel alloc]init];
    self.messageLabel.textColor = Text_Color_999999;
    self.messageLabel.text = @"这是最新最新最新最新最新最新最新最新最新最新最新最新最新最新最新最新最新最新最新最新最新最新的消息呀";
    self.messageLabel.font = BHFont_Size_12;
    [self addSubview:self.messageLabel];
    [self.messageLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.nameLabel.mas_bottom).offset(10);
        make.left.equalTo(self.headImage.mas_right).offset(10);
        make.right.equalTo(self.mas_right).offset(- 35);
    }];
    //时间
//    self.timeLabel = [[UILabel alloc]init];
////    self.timeLabel.textColor = Text_Color_35343D;
//    self.timeLabel.text = @"上午11:14";
//    self.timeLabel.font = BHFont_Size_11;
//    [self addSubview:self.timeLabel];
//    [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.equalTo(self).offset(20);
//        make.right.equalTo(self.mas_right).offset(- 15);
//    }];
    
    self.messageNumberLabel = [[UILabel alloc]init];
    self.messageNumberLabel.textColor = [UIColor whiteColor];
    self.messageNumberLabel.backgroundColor = [UIColor redColor];
    self.messageNumberLabel.font = BHFont_Size_7;
    self.messageNumberLabel.layer.cornerRadius = 15.0/2;
    self.messageNumberLabel.textAlignment = NSTextAlignmentCenter;
    self.messageNumberLabel.clipsToBounds = YES;
    [self addSubview:self.messageNumberLabel];
    [self.messageNumberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.headImage.mas_top);
        make.right.equalTo(self.headImage.mas_right).offset(5);
        make.height.width.offset (15);
    }];
}

@end
